import request from '@/utils/request_zc'

export function getVehicleDispatching ({
  page,
  limit
}) {
  return request({
    url: '/wms/vehicle/dispatch/list',
    method: 'get',
    params: {
      page,
      limit,
    }
  })
}

export function getVehicleDispatchingDetail ({ id }) {
  return request({
    url: `/wms/vehicle/dispatch/detail/${id}`,
    method: 'get',
  })
}

export function editCarrierApplication ({
  carrier,
  carryId,
  contact,
  customerId,
  deliveryAddress,
  deliveryDate,
  detailList,
  dispatchNo,
  distance,
  id,
  outboundNo,
  phone,
  remark
}) {
  return request({
    url: '/wms/vehicle/dispatch/edit',
    method: 'post',
    data: {
      carrier,
      carryId,
      contact,
      customerId,
      deliveryAddress,
      deliveryDate,
      detailList,
      dispatchNo,
      distance,
      id,
      outboundNo,
      phone,
      remark
    }
  })
}

export function addCarrierApplication ({
  carrier,
  carryId,
  contact,
  customerId,
  deliveryAddress,
  deliveryDate,
  detailList,
  dispatchNo,
  distance,
  outboundNo,
  phone,
  remark
}) {
  return request({
    url: '/wms/vehicle/dispatch/add',
    method: 'post',
    data: {
      carrier,
      carryId,
      contact,
      customerId,
      deliveryAddress,
      deliveryDate,
      detailList: detailList || [],
      dispatchNo,
      distance,
      outboundNo,
      phone,
      remark
    }
  })
}



